package com.tommy.ddp.disposeHandler
{
	import com.tommy.ddp.GridDataManager;
	import com.tommy.ddp.box.DdpBox;
	import com.tommy.ddp.definition.BoxColorType;

	/**
	 * 彩蛋爆炸（被动爆炸，主动触发在SWAPHANDLER里处理）
	 * 随机挑一种色彩的球消除
	 * @author hongxuan
	 * 
	 */
	public class SuperBoomDisposeHandler implements IDisposeHandler
	{
		public function SuperBoomDisposeHandler()
		{
			super();
		}
		public function dispose(box:DdpBox):Vector.<DdpBox>
		{
			box.dispose();
			GridDataManager.removeBox(box);
			
			var vect:Vector.<DdpBox> = new Vector.<DdpBox>();
			var color:uint = BoxColorType.randomColorType;
			color = BoxColorType.COLOR_1;
			var array:Array = GridDataManager.allBox.slice();
			for each(var i:DdpBox in array)
			{
				if(i.colorType == color)
					vect.push(i);
			}
			return vect;
		}
	}
}